function export_result2(RS2, RS, scale_vec, xl, fig_title, lr, lr_target, folder_save)

% figure settings
scrsz = get(0,'ScreenSize');
set(0,'defaulttextinterpreter','latex')
set(0,'defaultaxesfontname','times')
set(0,'DefaultAxesFontSize',29); 
set(0,'DefaultTextFontSize',35);
set(0,'DefaultAxesTitleFontWeight','bold');

% font size
fs1 = 42;

% colors
color1 = 'k';
color2 = [0.3 0.3 0.3]; % light gray

% marker
marker_size = 18; 
ms = 'o';
ms2 = 'x';

% line
ls = ':';
ls2 = '--';

l_width  = 2.7;
l_width2 = 2.2;

% set x-axis ticks. 
ns = length(scale_vec);
if lr==0
    ii = find(scale_vec==1); % baseline value 
elseif lr==1
    ii = find(scale_vec==lr_target); % baseline value 
end

i_vec = find(scale_vec>=0.5 & scale_vec<=2);
xtick_set = i_vec;
xtick_label = num2cell(scale_vec);
xtick_label = xtick_label(xtick_set,:);
xtick_set = 1:length(xtick_label);

xl = 'cost ($c^1_{jk}$) multiplier';

% horizontal line at 0
y0 = zeros(size(i_vec));

%% prices
fig_position = scrsz./[1.5 1.5 4 3]; % home office dell monitor setting
fig = figure('Color','w','Position',fig_position);
hold on
k1=plot(RS.p1_vec(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size);
k2=plot(RS2.p1_vec(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms2,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size, 'linestyle',ls2);
ylabel('\% change', 'Interpreter','Latex')
plot(y0, 'linestyle', ls, 'Color', color2, 'linewidth',l_width2)
xlabel(xl,'Interpreter','Latex')
set(gca,'Xtick', xtick_set, 'XTickLabel', xtick_label);
title('\% change in initial rate, $p_{j1}$', 'Interpreter','Latex', 'FontSize', fs1,...
    'FontWeight','bold')
xlim([0.7*min(xtick_set) 1.1*max(xtick_set)])
kk=legend([k1,k2],...
    'Baseline Medicaid',...
    'More generous Medicaid');
set(kk,'Location', 'northeast');
legend('boxoff');
print('-depsc2',[fullfile(folder_save, 'cf_p1_medi') '.eps']);

fig = figure('Color','w','Position',fig_position);
ly = 1.3*min(RS.p2_vec(i_vec));
uy = 1.3*max(RS.p2_vec(i_vec));
hold on
k1=plot(RS.p2_vec(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size);
k2=plot(RS2.p2_vec(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms2,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size, 'linestyle',ls2);
ylabel('\% change', 'Interpreter','Latex')
plot(y0, 'linestyle', ls, 'Color', color2, 'linewidth',l_width2)
xlabel(xl,'Interpreter','Latex')
set(gca,'Xtick', xtick_set, 'XTickLabel', xtick_label);
title('\% change in revised rate, $p_{jk2}$', 'Interpreter','Latex', 'FontSize', fs1)
ylim([ly uy])
xlim([0.7*min(xtick_set) 1.1*max(xtick_set)])
kk=legend([k1,k2],...
    'Baseline Medicaid',...
    'More generous Medicaid');
legend('boxoff');
print('-depsc2',[fullfile(folder_save, 'cf_p2_medi') '.eps']);

%% n_insurer
ly = 1.4*min([RS.n_vec(i_vec); RS2.n_vec(i_vec)]);
uy = 1.2*max(RS2.n_vec(i_vec));
fig = figure('Color','w','Position',fig_position);
hold on
k1=plot(RS.n_vec(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size);
k2=plot(RS2.n_vec(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms2,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size, 'linestyle',ls2);
ylabel('\% change', 'Interpreter','Latex')

plot(y0, 'linestyle', ls, 'Color', color2, 'linewidth',l_width2)
xlabel(xl,'Interpreter','Latex')
set(gca,'Xtick', xtick_set, 'XTickLabel', xtick_label);
title('\% change in \# of fringe entrants', 'Interpreter','Latex', 'FontSize', fs1)
kk=legend([k1,k2],...
    'Baseline Medicaid',...
    'More generous Medicaid');
legend('boxoff');
ylim([ly uy])
xlim([0.7*min(xtick_set) 1.1*max(xtick_set)])
print('-depsc2',[fullfile(folder_save, 'cf_n_medi') '.eps']);

%% profits 
ly = 1.3*min(RS.profit_major(i_vec));
uy = 1.3*max(RS.profit_major(i_vec));
fig = figure('Color','w','Position',fig_position);
hold on
k1=plot(RS.profit_major(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size);
k2=plot(RS2.profit_major(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms2,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size, 'linestyle',ls2);
ylabel('\% change', 'Interpreter','Latex')
plot(y0, 'linestyle', ls, 'Color', color2, 'linewidth',l_width2)
xlabel(xl,'Interpreter','Latex')
set(gca,'Xtick', xtick_set, 'XTickLabel', xtick_label);
title('\% change in major firm profit','Interpreter','Latex', 'FontSize', fs1)
ylim([ly uy])
xlim([0.7*min(xtick_set) 1.1*max(xtick_set)])
kk=legend([k1,k2],...
    'Baseline Medicaid',...
    'More generous Medicaid');
legend('boxoff');
print('-depsc2',[fullfile(folder_save, 'cf_w_m_medi') '.eps']);


ly = 1.5*min(RS.profit_minor(i_vec));
uy = 1.3*max(RS.profit_minor(i_vec));
fig = figure('Color','w','Position',fig_position);
hold on
k1=plot(RS.profit_minor(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size);
k2=plot(RS2.profit_minor(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms2,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size, 'linestyle',ls2);
ylabel('\% change', 'Interpreter','Latex')
plot(y0, 'linestyle', ls, 'Color', color2, 'linewidth',l_width2)
xlabel(xl,'Interpreter','Latex')
set(gca,'Xtick', xtick_set, 'XTickLabel', xtick_label);
title('\% change in fringe profit','Interpreter','Latex', 'FontSize', fs1)
ylim([ly uy])
xlim([0.7*min(xtick_set) 1.1*max(xtick_set)])
kk=legend([k1,k2],...
    'Baseline Medicaid',...
    'More generous Medicaid');
legend('boxoff');
print('-depsc2',[fullfile(folder_save, 'cf_w_f_medi') '.eps']);

%% consumer welfare & enrollment
ly = -1.3*max(abs(RS.welfare_vec(i_vec)));
uy = 0.8*max(abs(RS.welfare_vec(i_vec)));
fig = figure('Color','w','Position',fig_position);
hold on
k1=plot(RS.welfare_vec(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size);
k2=plot(RS2.welfare_vec(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms2,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size, 'linestyle',ls2);
ylabel('\% change', 'Interpreter','Latex')
plot(y0, 'linestyle', ls, 'Color', color2, 'linewidth',l_width2)
xlabel(xl,'Interpreter','Latex')
set(gca,'Xtick', xtick_set, 'XTickLabel', xtick_label);
title('\% change in consumer welfare','Interpreter','Latex', 'FontSize', fs1)
ylim([ly uy])
xlim([0.7*min(xtick_set) 1.1*max(xtick_set)])
xlim([0.7*min(xtick_set) 1.1*max(xtick_set)])
kk=legend([k1,k2],...
    'Baseline Medicaid',...
    'More generous Medicaid');
set(kk,'Location', 'southeast');
legend('boxoff');
print('-depsc2',[fullfile(folder_save, 'cf_w_c_medi') '.eps']);

ly = -1.2*max(abs(RS.enroll_vec(i_vec)));
uy = 1.2*max(abs(RS.enroll_vec(i_vec)));
fig = figure('Color','w','Position',fig_position);
hold on
k1=plot(RS.enroll_vec(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size);
k2=plot(RS2.enroll_vec(i_vec),...
    'Color',color1,'linewidth',l_width,...
    'marker',ms,'markeredgecolor',color1,'markerfacecolor',[1 1 1],'markersize',marker_size, 'linestyle',ls2);
ylabel('\% change', 'Interpreter','Latex')
plot(y0, 'linestyle', ls, 'Color', color2, 'linewidth',l_width2)
xlabel(xl,'Interpreter','Latex')
set(gca,'Xtick', xtick_set, 'XTickLabel', xtick_label);
title('\% change in privately insured rate', 'Interpreter','Latex', 'FontSize', fs1)
xlim([0.7*min(xtick_set) 1.1*max(xtick_set)])
kk=legend([k1,k2],...
    'Baseline Medicaid',...
    'More generous Medicaid');
set(kk,'Location', 'southwest');
legend('boxoff');
print('-depsc2',[fullfile(folder_save, 'cf_insured_medi') '.eps']);



